package com.sbl.bajw.pc.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sbl.bajw.mapper.StreetDeptModelDao;
import com.sbl.bajw.pc.model.DeptModel;

@Service
public class StreetDeptService {
	
	@Resource
	private StreetDeptModelDao dao;
	
	public List<DeptModel> getDept(String pid){
		List<DeptModel> list = dao.getOrgByCons(pid);
		return list;
	}
	
	public List<DeptModel> getOrgPid(String pid){
		
		HashMap<String, Object> parm = new HashMap<String, Object>();
		parm.put("pid", pid);
		
		List<DeptModel> list = dao.getOrgPid(parm);
		return list;
	}
	
	public DeptModel getOrgById(String id){
		DeptModel model = dao.getOrgById(id);
		return model;
	}
	
	public List<DeptModel> getOrgByLevel(String level,String fullid){
		HashMap<String, Object> parm = new HashMap<String, Object>();
		parm.put("level", level);
		parm.put("fullid", fullid+"%");
		
		List<DeptModel> list = dao.getOrgByLevel(parm);
		return list;
	}
	
	public List<Map<String, Object>> getInitOrg(HashMap<String, Object> parm){
		List<Map<String, Object>> list = dao.getInitOrg(parm);
		return list;
	}
}
